From: Jonas Ã…dahl Date: Fri, 10 Aug 2018 15:07:05 +0000 (+0200) Subject: gdk/wayland: Don't remap non-subsurface as subsurface X-Git-Tag: archive/raspbian/3.24.39-1+rpi1~1^2~65^2~32^2~69^2~2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1ed53199c56cf8927efe417c05ab4424f32b30e5;p=gtk%2B3.0.git gdk/wayland: Don't remap non-subsurface as subsurface Let's just use the fact that a window was mapped as a subsurface to remap it above another transient parent instead of relying on the more complicated 'should-map-as-subsurface' helper function. --- diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index 3da3ac5b68..fa3e0e48a0 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -3799,6 +3799,7 @@ gdk_wayland_window_set_transient_for (GdkWindow *window, GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); GdkWindow *previous_parent; + gboolean was_subsurface = FALSE; g_assert (parent == NULL || gdk_window_get_display (window) == gdk_window_get_display (parent)); @@ -3812,7 +3813,10 @@ gdk_wayland_window_set_transient_for (GdkWindow *window, unset_transient_for_exported (window); if (impl->display_server.wl_subsurface) - unmap_subsurface (window); + { + was_subsurface = TRUE; + unmap_subsurface (window); + } previous_parent = impl->transient_for; impl->transient_for = parent; @@ -3825,9 +3829,10 @@ gdk_wayland_window_set_transient_for (GdkWindow *window, display_wayland->orphan_dialogs = g_list_remove (display_wayland->orphan_dialogs, window); } + gdk_wayland_window_sync_parent (window, NULL); - if (should_map_as_subsurface (window) && - parent && gdk_window_is_visible (window)) + + if (was_subsurface && parent) gdk_wayland_window_create_subsurface (window); }